package com.banana.manager.forest.controller.info;

import com.banana.manager.forest.entity.info.DiseaseBean;
import com.banana.manager.forest.service.impl.info.DiseaseServiceImpl;
import com.github.pagehelper.PageInfo;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/disease")
public class DiseaseController {

    @Resource
    private DiseaseServiceImpl diseaseService;

    @PostMapping("/addDisease")
    public DiseaseBean addDisease(@RequestBody DiseaseBean diseaseBean){
        return diseaseService.addDisease(diseaseBean);
    }

    @GetMapping("/showDisease")
    public DiseaseBean getOneDiseaseBean(Integer diseaseId){
        return diseaseService.findOneById(diseaseId);
    }

    @GetMapping("/displayDisease")
    public PageInfo<DiseaseBean> getDiseaseLists(Integer page, String diseaseName, String diseaseSymptom){
        return diseaseService.findBlurByPage(page, diseaseName, diseaseSymptom);
    }


}
